using Engine;
using Game;
using GameEntitySystem;

namespace SCIENEW {
    public class MachineToolDevice : FourDirectionalDevice, ICrafterDevice<ComponentExCraftingTable>, IElectricElementDevice {
        public MachineToolDevice() : base("MachineToolDevice", 105, 105, 105, 146) {

        }

        public string GetEntityName(int value) => "ExCraftingTable";

        public Widget GetWidget(IInventory inventory, ComponentExCraftingTable component) => new MachineToolWidget(inventory, component);

        public override DeviceBehavior[] GetBehaviors(Project project) => [new MachineToolDeviceBehavior(project)];

        public ElectricElement CreateElectricElement(SubsystemElectricity subsystemElectricity, int value, int x, int y, int z) => new MachineToolElectricElement(subsystemElectricity, new Point3(x, y, z));

        public ElectricConnectorType? GetConnectorType(SubsystemTerrain terrain, int value, int face, int connectorFace, int x, int y, int z) => face is 4 or 5 ? ElectricConnectorType.Input : null;

        public int GetConnectionMask(int value) => int.MaxValue;
    }
}